package com.zw.stock_sell_storage.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zw.stock_sell_storage.dto.MyPageDto;
import com.zw.stock_sell_storage.dto.SaleInformationDto;
import com.zw.stock_sell_storage.dto.ex.QueryTimeScopeDtoEx;
import com.zw.stock_sell_storage.dto.ex.SaleInformationDtoEx;
import com.zw.stock_sell_storage.service.ISaleInformationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/saleInformation")
public class SaleInformationController {

    @Autowired
    ISaleInformationService iSaleInformationService;

    @RequestMapping("/querySaleInformationList")
    public Page<SaleInformationDto> querySaleInformationList(@RequestBody MyPageDto<QueryTimeScopeDtoEx<SaleInformationDto>> myPageDto){
        return iSaleInformationService.querySaleInformationList(myPageDto);
    }

    @RequestMapping("/querySaleInformationById")
    public SaleInformationDtoEx querySaleInformationById(int saleId){
        return iSaleInformationService.querySaleInformationById(saleId);
    }

    @RequestMapping("/addSaleInformation")
    public boolean addSaleInformation(@RequestBody SaleInformationDto saleInformationDto){
        return iSaleInformationService.addSaleInformation(saleInformationDto);
    }
}
